import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import styleImport from 'vite-plugin-style-import';

export default defineConfig({
    plugins: [
        vue(),
        styleImport({
            libs: [{
                libraryName: 'vant',
                esModule: true,
                resolveStyle: (name) => `vant/es/${name}/style`
            }]
        })
    ],
    server: {
        host: '0.0.0.0',
        port: 5000,
        https: false,
        proxy: {
            '/api': {
                target: 'http://192.168.31.50:8080/',
                changeOrigin: true,
                rewrite: path => path.replace(/^\/api/, '/api')
            }
        }
    }
})